import request from '@/utils/request'
import defaultSettings from '@/settings'

export const apiUrlConfig = {
  queryUrl: `${defaultSettings.ctx.authorityApp}/userFile/search`,
  exportUrl: `${defaultSettings.ctx.authorityApp}/userFile/search`,
  delUrl: `${defaultSettings.ctx.authorityApp}/userFile/remove`,
}


// 查询登录日志列表
export function listUserFile(query,isExport = false) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/userFile/search`,
    method: 'get',
    params: query,
    isExport: isExport
  })
}

// 下载
export function download(fileId) {
  console.log(fileId)
  let url = `${(defaultSettings.ctx.authorityApp == '' ? 'authority-app' : defaultSettings.ctx.authorityApp)}/userFile/newDownload?fileId=${fileId}`;
  window.location.href = url;
}


// 删除
export function delUserFile(id) {
  return request({
    url: `${defaultSettings.ctx.authorityApp}/userFile/remove?id=${id}`,
    method: 'post'
  })
}


